<!--
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-04-27 14:42:20
 * @LastEditTime: 2022-05-13 22:12:51
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue@3"></script>
</head>

<body>
  <div id="app">
    <ul>
      <li v-for="(item,index) in list">
        {{item.name+'---'+item.age}}
        <input type="text" @change="change" v-model.lazy="data">{{data}}
      </li>
    </ul>
    <button @click="add">添加</button>
    <componentA></componentA>
  </div>
  <script>
    Vue.createApp({
      components:[componentA],
      data() {
        return {
          data:'',
          list: [
            { id: 1, name: '张三', age: 12 },
            { id: 2, name: '李四', age: 13 },
          ]
        }
      },
      methods: {
        add() {
          this.list = [
            { id: 3, name: '小王', age: 14 },
            ...this.list
          ]
        },
        change() {}
      },
    }).mount('#app')
      const componentA = {
        template: "<div>导航一内容</div>"
      }
  </script>
</body>

</html>